package com.ljw.user.service;

import com.ljw.spring.*;
import com.sun.net.httpserver.Filter;
import com.sun.net.httpserver.HttpExchange;

import java.io.IOException;


/**
 * @author 一朝风月
 * @date 2024/6/8 17:28
 * @Code 面向注解面向卿，终无解释再无你
 * @description 实现生命周期回调
 */
@Transactional
@Component
public class UserService implements BeanNameAware, ApplicationContextAware {
    @Autowired
    private OrderService orderService;
//    @Autowired
//    private Filter filter;

//    public void main(){
//        Filter filter1=new Filter() {
//            @Override
//            public void doFilter(HttpExchange exchange, Chain chain) throws IOException {
//                System.out.println("do");
//            }
//
//            @Override
//            public String description() {
//                return null;
//            }
//        };
//    }
    private String beanName;
    private WinterFlyApplicationContext applicationContext;
    public  void test(){
        System.out.println(orderService);
        System.out.println(applicationContext);
        System.out.println(beanName);
    }
    @Override
    public void setApplicationContext(WinterFlyApplicationContext context) {
    this.applicationContext=context;
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;

    }
}
